<template>
    <div class="checkout_nav">
        <!--1-->
        <div class="home_nav">
            <div class="glyphicon glyphicon-menu-left col-xs-4 home_nav_left fs16" @click="$router.go(-1)"></div>
            <div class="col-xs-4 home_nav_middle fs18">收银台</div>
            <div class="glyphicon glyphicon-option-vertical col-xs-4 home_nav_right fs16"></div>
        </div>
        <!--2-->
        <div class="checkout_detail fs14">
            <div class="checkout_detail_one" v-for="item of goodsdata">
                <div class="one_detail">{{item.goods_name}}</div>
                <div class="two_detail">{{item.goods_quantity}}</div>
                <div class="three_detail">￥{{item.pay_price}}</div>
            </div>
        </div>
        <!--3-->
        <div class="payall fs14">合计：￥{{orderdata.pay_price}}</div>
        <!--4-->
        <div class="company_name fs14"><span class="pull-left">公司名称</span><span class="pull-right">{{shelfdata.shop}}</span></div>
        <!--5-->
        <div class="company_name fs14"><span class="pull-left">货架名称</span><span class="pull-right">{{shelfdata.name}}</span></div>
        <!--6-->
        <div class="company_name fs14"><span class="pull-left">地点</span><span class="pull-right">{{shelfdata.address}}</span></div>
        <!--7-->
        <div class="lastpay fs14"><span class="pull-left">付款金额：</span><span class="lastpaystyle pull-left">￥{{orderdata.pay_price}}</span><div class="weixinpay pull-right">微信付款</div></div>
        <!--8-->
    </div>
</template>
<script>
      import axios from 'axios'
export default{
    name:'checkout',
    data(){
        return{
            goods:null,
            shelf:null,
            order:null,
            wechat:null,
            goodsdata:[
                {
                    "goods_id":1,
                    "unique_shelf_goods_id":413453,
                    "goods_name":"红牛维生素功能饮料250ml",
                    "goods_quantity":2,
                    "goods_price":"6.00",
                    "shelf_price":"6.00",
                    "pay_price":"6.00",
                    "dish_price":"6.00",
                    "order_id":"201712021637061017",
                    "updated_at":"2017-12-02 16:37:06",
                    "created_at":"2017-12-02 16:37:06",
                    "id":15823
                }
            ],
            shelfdata:{
                "id":4,
                "unique_id":2131,
                "shop":"菜果果电子商务有限公司",
                "name":"菜果果",
                "province":"河南省",
                "city":"郑州市",
                "area":"管城回族区",
                "address":"东风南路榆林南路文化产业大厦B座2003",
                "qr_code":"/qrcode/2131.png",
                "area_id":2,
                "emp_id":10,
                "status":1,
                "note":"",
                "admin_id":1,
                "deleted_at":null,
                "created_at":"2017-09-17 17:59:27",
                "updated_at":"2017-11-23 15:29:26",
                "purchase":1,
                "time":1505894037,
                "company_id":0,
                "city_id":0
            },
            orderdata:{
                    "id":12018,
                    "unique_id":1017,
                    "order_id":"201712021637061017",
                    "transaction_id":"wx20171202163706bc538236e50379406467",
                    "user_id":0,
                    "user_wechat_openid":"ogU7E0bfJJxqekVizUdd0rm2fjZQ",
                    "shelf_id":4,
                    "price":"12.00",
                    "sell_price":"12.00",
                    "pay_price":"12.00",
                    "type":1,
                    "come_from":1,
                    "quantity":2,
                    "pay_time":null,
                    "succ_time":null,
                    "pay_status":0,
                    "status":0,
                    "deleted_at":null,
                    "created_at":"2017-12-02 16:37:06",
                    "updated_at":"2017-12-02 16:37:06",
                    "city_id":0
             },
             wechatdata:{
                   "appId":"wxb3412db141e7e659",
                    "nonceStr":"5a2266324c0d6",
                    "package":"prepay_id=wx20171202163706bc538236e50379406467",
                    "signType":"MD5",
                    "paySign":"FB8E0C8B56B84314BDD1CF352404704C",
                    "timestamp":"1512203826"
             }
        }
    },
    created:function(){
         axios({
                url:this.$store.state.url +  '/shop/user/order/store',
                method:'post',
                data:{
                    unique_id:2133,
                },
                 headers :{
                    'Accept': 'application/json',
                     token:this.$store.state.tokenhongqi
                }
            })
            .then((res)=>{
                console.log(res.data);
                // this.goods=res.data.goods;
                // this.shelf=res.data.shelf;
                // this.order=res.data.order;
                // this.wechat=res.data.wechat;
            })
    }
}
</script>
<style scoped>
.checkout_nav{background-color: #fbf9fe;width:100%;height: 100vh;}
/*1*/
  .home_nav{height:7.3vh;width: 100%;background-color: #21292c;color: white;}
  .home_nav_left{line-height: 7.3vh;}
  .home_nav_middle{line-height: 7.3vh;text-align: center;letter-spacing: 2px;}
  .home_nav_right{line-height: 7.3vh;text-align: right;}
  /*2*/
  .checkout_detail{margin-top:1.66vh;width: 100%;padding:2.6%;background-color: white;border-bottom: 1px solid #eee;border-top: 1px solid #eee;}
  .checkout_detail_one{width: 100%;}
  .checkout_detail_one>div{display: inline-block}
  .one_detail{width:50%}
  .two_detail{width: 27%}
  .three_detail{width: 20%;}
  /*3*/
  .payall{width: 100%;height: 10.2vh;padding:2.6%;text-align: right;}
  /*4/5/6*/
  .company_name{width: 100%;height:6.8vh;background-color: #fff;line-height: 6.8vh;padding-left:2.6%;padding-right: 2.6%;border-bottom: 1px solid #eee;border-top: 1px solid #eee;}
 /*7*/
 .lastpay{width: 100%;padding: 2.6%;margin-top: 7px;}
 .lastpaystyle{color: red;}
 .weixinpay{width:31.8%;height:7vh;background-color:#05bd05;line-height: 7vh;text-align: center;color: white;border-radius:6px; }
</style>